Skip to content

Implement CalendarService #154

Open
kevinlee-06 wants to merge 10 commits intomainfrom
NTUT-Calendar-Service
Open

Implement CalendarService #154
kevinlee-06 wants to merge 10 commits intomainfrom
NTUT-Calendar-Service

Conversation

@kevinlee-06
Copy link

Overview

This pull request adds a new CalendarService to the app, enabling retrieval of NTUT calendar events via the portal's calModeApp.do JSON API. The service is integrated with the existing dependency injection setup and is thoroughly tested with new unit and debug tests. Documentation and agent status are updated to reflect this new capability.

Academic Calendar Integration

  • Added CalendarService to fetch calendar events using the portal session and calModeApp.do API. Includes a strongly-typed DTO for events and a Riverpod provider for DI.
  • Exposed portalDio in PortalService for use by services sharing the portal host, such as CalendarService.

Testing

  • Added unit tests for CalendarService in test/services/calendar_service_test.dart, verifying event retrieval and structure.
  • Added a debug test in test/services/cal_debug_test.dart to print raw calendar event data for inspection.

@rileychh-dokploy-riley-ntut-npc
Copy link

rileychh-dokploy-riley-ntut-npc bot commented Mar 2, 2026

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
API Docs ✅ Done Preview URL 2026-03-11T14:43:34.668Z

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

PR Preview Builds

Build Number: 615
Commit: 0b873f1
Message: refactor: consolidate academic calendar event fetching into PortalService and remove CalendarService.

Deploy

  • Android (Firebase App Distribution)
  • iOS (TestFlight)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an NTUT Portal academic calendar integration by introducing a new CalendarService that fetches events from calModeApp.do, wiring it into existing Riverpod DI and updating repository docs/tests accordingly.

Changes:

  • Introduces CalendarService + CalendarEventDto and a Riverpod provider to fetch calendar events via the portal session.
  • Exposes portalDio from PortalService so other services on the same host can reuse the authenticated client.
  • Adds integration/debug tests and updates AGENTS.md status entries.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/services/calendar_service.dart New service/DTO/provider to fetch and parse calendar events from the portal JSON API.
lib/services/portal_service.dart Exposes the underlying portal Dio instance for reuse by same-host services.
test/services/calendar_service_test.dart Adds integration tests for calendar retrieval and basic DTO structure.
test/services/cal_debug_test.dart Adds a manual-style debug test that prints raw/expanded calendar data.
AGENTS.md Updates agent/status documentation to include CalendarService and a new “Last updated” date.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kevinlee-06 kevinlee-06 requested a review from rileychh March 3, 2026 08:42
@kevinlee-06 kevinlee-06 requested a review from rileychh March 11, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants